import mockjs from 'mockjs';

const valueEnum = {
  0: 'close',
  1: 'running',
  2: 'online',
  3: 'error',
};
export default {
  // 使用 mockjs 等三方库
  'GET /api/device/list': mockjs.mock({
    'data|100': [
      {
        'key|1-1000': 50,
        'name|1-1000': 500,
        'deviceId|1-100': 500,
        'battery|1-100': 50,
        'version|1-100': 50,
        batteryTime: '2023/04/05 17:30~2023/04/05 22:30',
        status: valueEnum[Math.floor(Math.random() * 10) % 4],
        creator: '康',
        gmtCreate: Date.now() - Math.floor(Math.random() * 100000),
        memo: 'notification',
      },
    ],
    success: true,
    total: 100,
  }),
};
